package com.sx.first.biz;

import java.util.List;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;

import com.sx.first.biz.EmployeeBiz;
import com.sx.first.dao.EmployeeDAO;
import com.sx.first.model.Employee;

@Service("employeeBiz")
@Scope("prototype")
public class EmployeeBiz {
	private EmployeeDAO employeeDAO;
	

	public void setEmployeeDAO(EmployeeDAO employeeDAO) {
		this.employeeDAO = employeeDAO;
	}

	public List<Employee> findAll() {
		return employeeDAO.findAll();
	}

	public void save(Employee emp) {
		employeeDAO.save(emp);
		
	}
	public void delete(int empId) {
		employeeDAO.delete(employeeDAO.findById(empId));
		
	}

	public void update(Employee emp) {
		employeeDAO.update(emp);
		
	}
	public Employee findById(int empId) {
		return employeeDAO.findById(empId);
	}

	public List<Employee> findApply() {
		return employeeDAO.findApply();
	}
	
	
}
